<?php

class Users_FlashAction extends SrsDashboardBaseAction
{
	public function isSecure()
	{
		return false;
	}

	public function execute()
	{
		$user = $this->context->getUser();
		
		if (!$user instanceof AgaviISecurityUser)
		{
			return;
		}

		$flash = $user->getFlash();

		if (empty($flash))
		{
			return;
		}

		$this->setAttribute('message', $flash[0]);
		$this->setAttribute('type', $flash[1]);

		return 'Success';
	}
}